1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a computer-readable storage medium storing a program for implementing the image processing method, and in particular to an image processing technique of geometrically deforming a taken image.
2. Description of the Related Art
As digital cameras have been becoming widespread, camera bodies have been increasingly downsized and angles of views have been widening. Under such circumstances, there has been a demand for evolution of shooting-assist functions in order to obtain satisfactory taken images in various scenes. For example, exemplary shooting-assist functions of geometrically deforming images include camera shake correction, electronic zooming, lens distortion correction, and correction for distortions caused by a rolling shutter of a sensor (hereafter referred to as “rolling shutter distortions”). It should be noted that in the following description, a “lens distortion correction” and a “rolling shutter distortion correction” will be referred to as “distortion corrections”. It is preferred that the plurality of corrections and zooming are used in orders compliant with geometric roles so as to obtain desired effects.
A plurality of deformation elements which are geometrical (hereafter referred to as “geometric deformation elements”), however, needs to be collectively computed so as to enhance ease of use by increasing image processing speed and realize real-time processing (a taken image is checked on the spot, for example) of digital cameras. Accordingly, a computation method that combines amounts of deformations caused by a plurality of geometric elements is required.
As an exemplary method to collectively compute a plurality of geometric elements, there has been proposed a method that obtains an enlargement-reduction rate of an image based on chromatic aberration so as to correct for chromatic aberration and distortion of a lens (see Japanese Laid-Open Patent Publication (Kokai) No. 2004-336106). Also, as an exemplary method to correct for rolling shutter distortion and lens distortion at the same time, there has also been proposed a method that divides an image, measures rolling shutter distortions of the respective split images, and adds them and lens distortion correction amounts together (see Japanese Laid-Open Patent Publication (Kokai) No. 2006-186884).
Processing capabilities of a processing circuit which can be mounted on a digital camera are limited, and it is uneasy to obtain high-quality images by carrying out the above geometric deformations without making users to wait.
For example, according to the method described in Japanese Laid-Open Patent Publication (Kokai) No. 2004-336106, two elements consisting of a chromatic aberration and a lens distortion are geometric deformation elements, and both of them are used to correct for a deviation from an ideal state of a formed image due to lens refraction. Accordingly, by using a special method that increases and decreases the amount of change caused by distortion obtained in a preceding stage according to a difference in refractive index between colors by taking advantage of similar properties of color aberration and lens distortion, problems arising from a plurality of image processes being combined are circumvented. Therefore, this method cannot be applied to an object of efficiently processing geometric deformation elements having different properties, i.e. lens distortion and camera shake.
On the other hand, according to the method described in Japanese Laid-Open Patent Publication (Kokai) No. 2006-186884, geometric deformation elements with different properties, a rolling shutter distortion and a lens distortion are targeted for correction. According to this method, however, the amounts of change relating to a plurality of geometric deformation elements which should originally be calculated in succession are calculated at a time based on pre-transformation coordinates, and hence processing accuracy (image quality) is compromised instead of processing speed. On the other hand, when an arrangement in which the amounts of change relating to a plurality of geometric deformation elements are not calculated at a time, but processing circuits for a plurality of geometric deformation elements are simply connected together based on geometric rules, and images output from the respective processing circuits are input to processing circuits in succeeding stages is adopted, expensive computation circuits are required so as to realize high processing accuracy and high-speed processing.